import Vue from 'vue';
import Vuex from 'vuex';
import app from './modules/app';
import errorLog from './modules/errorLog';
import permission from './modules/permission';
import tagsView from './modules/tagsView';
import user from './modules/user';
import getters from './getters';
import business from './modules/business';

Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        // determine user permission
        userType: {
            admin: 0,
            normal: 1
        },
        // enum for audit step
        auditType: {
            notSubmit: 0,
            auditing: 1,
            reject: 2,
            pass: 3
        },
        // audit user type
        registryType: {
            buyer: 1,
            seller: 2
        },
    },
    modules: {
        app,
        errorLog,
        permission,
        tagsView,
        user,
        business
    },
    getters
});

export default store;
